package bb.lanxing.lib.devices.ble.x1;

import android.os.RemoteException;
import bb.lanxing.lib.devices.base.DeviceContext;
import bb.lanxing.lib.devices.utils.DeviceManagerHelper;

public class RemoteX1ControllerImpl extends IRemoteX1Contraoller.Stub {
    private X1Controller mController;

    public RemoteX1ControllerImpl(String str) {
        if (DeviceContext.getDeviceManager() != null) {
            this.mController = DeviceManagerHelper.getX1Controller();
        }
    }

    @Override
    public void set(int i, float f, int i2) throws RemoteException {
        X1Controller x1Controller = this.mController;
        if (x1Controller != null) {
            x1Controller.set(i, f, i2);
        }
    }

    @Override
    public void reset(X1DisplayData x1DisplayData) throws RemoteException {
        X1Controller x1Controller = this.mController;
        if (x1Controller != null) {
            x1Controller.reset(x1DisplayData);
        }
    }

    @Override
    public void send(X1DisplayData x1DisplayData) throws RemoteException {
        X1Controller x1Controller = this.mController;
        if (x1Controller != null) {
            x1Controller.send(x1DisplayData);
        }
    }

    @Override
    public boolean isConnected() throws RemoteException {
        X1Controller x1Controller = this.mController;
        return x1Controller != null && x1Controller.isConnected();
    }

    @Override
    public void stop() throws RemoteException {
        X1Controller x1Controller = this.mController;
        if (x1Controller != null) {
            x1Controller.stop();
        }
    }
}
